//@author A0080917B

#include "stdafx.h"
#include "CppUnitTest.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

//Constant int declarations for seconds:
const int ONEDAY = 24*60*60;
const int ONEWEEK = ONEDAY*7;

namespace ProcessTimeTest
{		
	TEST_CLASS(ProcessTimeUnitTests)
	{
	public:

		TEST_METHOD(YesterdayWithoutTimeStart)
		{
			std::string input = "yesterday";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			timeTExpected -= (24*60*60);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 0;
			structTimeTExpected.tm_min = 0;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(YesterdayWithoutTimeEnd)
		{
			std::string input = "yesterday";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			timeTExpected -= (24*60*60);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(YesterdayWithTime)
		{
			std::string input = "yesterday 0123";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			timeTExpected -= (24*60*60);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 01;
			structTimeTExpected.tm_min = 23;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TodayWithoutTimeStart)
		{
			std::string input = "today";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 0;
			structTimeTExpected.tm_min = 0;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TodayWithoutTimeEnd)
		{
			std::string input = "today";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TodayWithTime)
		{
			std::string input = "today 1234";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 12;
			structTimeTExpected.tm_min = 34;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TomorrowWithoutTimeStart)
		{
			std::string input = "tomorrow";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			timeTExpected += (24*60*60);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 0;
			structTimeTExpected.tm_min = 0;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TomorrowWithoutTimeEnd)
		{
			std::string input = "tomorrow";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			timeTExpected += (24*60*60);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TomorrowWithTime)
		{
			std::string input = "tomorrow 2345";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			timeTExpected += (24*60*60);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 45;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TodayWithInvalidTime)
		{
			std::string input = "today 23456";
			std::string expectedFeedback = INPUTERROR_INVALIDTIME;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(TomorrowWithInvalidDateTime)
		{
			std::string input = "tomorrow 2345 testing excess params";
			std::string expectedFeedback = INPUTERROR_INVALIDDATETIMEADDEDIT;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(MondayWithoutTimeStart)
		{
			std::string input = "Monday";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(1, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 0;
			structTimeNow.tm_min = 0;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= 0);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= (ONEDAY*7));
		}

		TEST_METHOD(WednesdayWithTime)
		{
			std::string input = "Wednesday 0303";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(3, structTimeT.tm_wday);
			Assert::AreEqual(3, structTimeT.tm_hour);
			Assert::AreEqual(3, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 3;
			structTimeNow.tm_min = 3;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= 0);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= (ONEDAY*7));
		}

		TEST_METHOD(ThisFridayWithoutTimeEnd)
		{
			std::string input = "this Friday";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(5, structTimeT.tm_wday);
			Assert::AreEqual(23, structTimeT.tm_hour);
			Assert::AreEqual(59, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 23;
			structTimeNow.tm_min = 59;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= 0);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= (ONEDAY*7));
		}

		TEST_METHOD(NextSundayWithTime)
		{
			std::string input = "next Sunday 0000";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(0, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 0;
			structTimeNow.tm_min = 0;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= ONEWEEK);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= (ONEWEEK+(ONEDAY*7)));
		}

		TEST_METHOD(LastTuesdayWithTime)
		{
			std::string input = "last Tuesday 1212";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(2, structTimeT.tm_wday);
			Assert::AreEqual(12, structTimeT.tm_hour);
			Assert::AreEqual(12, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 12;
			structTimeNow.tm_min = 12;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeNow, timeT) >= ONEDAY);
			Assert::IsTrue((int)difftime(timeNow, timeT) <= ONEWEEK);
		}

		TEST_METHOD(NextThursdayWithInvalidTime)
		{
			std::string input = "next Thursday 1:23";
			std::string expectedFeedback = INPUTERROR_INVALIDTIME;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(LastSaturdayWithTimeWithInvalidDateTimeWithWeek)
		{
			std::string input = "last Saturday 1616 testing excess params";
			std::string expectedFeedback = INPUTERROR_INVALIDDATETIMESHOWSEARCH;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(Week)
		{
			std::string input = "week";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(1, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 0;
			structTimeNow.tm_min = 0;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= -ONEWEEK);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= ONEWEEK);
		}

		TEST_METHOD(ThisWeek)
		{
			std::string input = "this week";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(1, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 0;
			structTimeNow.tm_min = 0;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= -ONEWEEK);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= ONEWEEK);
		}

		TEST_METHOD(NextWeek)
		{
			std::string input = "next week";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(1, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 0;
			structTimeNow.tm_min = 0;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeT, timeNow) >= ONEDAY);
			Assert::IsTrue((int)difftime(timeT, timeNow) <= ONEWEEK);
		}

		TEST_METHOD(LastWeek)
		{
			std::string input = "last week";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(1, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t timeNow;
			time(&timeNow);
			tm structTimeNow;
			localtime_s(&structTimeNow, &timeNow);
			structTimeNow.tm_hour = 0;
			structTimeNow.tm_min = 0;
			structTimeNow.tm_sec = 0;
			timeNow = mktime(&structTimeNow);
			Assert::IsTrue((int)difftime(timeNow, timeT) >= ONEWEEK);
			Assert::IsTrue((int)difftime(timeNow, timeT) <= (ONEWEEK*2));
		}

		TEST_METHOD(ThisWeekWithInvalidDateTimeWeek)
		{
			std::string input = "this week 1234";
			std::string expectedFeedback = INPUTERROR_INVALIDDATETIMESHOWSEARCH;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYWeek)
		{
			std::string input = "week 05/06/14";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			tm structTimeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			localtime_s(&structTimeT, &timeT);
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual(1, structTimeT.tm_wday);
			Assert::AreEqual(0, structTimeT.tm_hour);
			Assert::AreEqual(0, structTimeT.tm_min);
			Assert::AreEqual(0, structTimeT.tm_sec);

			time_t dateTime;
			tm structDateTime;
			localtime_s(&structDateTime, &dateTime);
			structDateTime.tm_year = 100 + 14;
			structDateTime.tm_mon = 6 - 1;
			structDateTime.tm_mday = 5;
			structDateTime.tm_hour = 0;
			structDateTime.tm_min = 0;
			structDateTime.tm_sec = 0;
			dateTime = mktime(&structDateTime);
			Assert::IsTrue((int)difftime(timeT, dateTime) >= -ONEWEEK);
			Assert::IsTrue((int)difftime(timeT, dateTime) <= ONEWEEK);
		}

		TEST_METHOD(DDMMYYWeekWithInvalidDateTimeWeek)
		{
			std::string input = "07/08/14 week 2345";
			std::string expectedFeedback = INPUTERROR_INVALIDDATETIMESHOWSEARCH;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(InvalidDateTime)
		{
			std::string input = "testing invalid params";
			std::string expectedFeedback = INPUTERROR_INVALIDDATETIMEADDEDIT;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYWeekWithInvalidDate)
		{
			std::string input = "07/O8/14 week";
			std::string expectedFeedback = INPUTERROR_INVALIDDATE;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYWithInvalidDate)
		{
			std::string input = "07/08/l4 1234";
			std::string expectedFeedback = INPUTERROR_INVALIDDATE;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = true;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYWithoutTimeStart)
		{
			std::string input = "01/02/18";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 18;
			structTimeTExpected.tm_mon = 2 - 1;
			structTimeTExpected.tm_mday = 1;
			structTimeTExpected.tm_hour = 0;
			structTimeTExpected.tm_min = 0;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYYWithoutTimeEnd)
		{
			std::string input = "11/12/50";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 50;
			structTimeTExpected.tm_mon = 12 - 1;
			structTimeTExpected.tm_mday = 11;
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYYWithTime)
		{
			std::string input = "11/12/50 1800";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 50;
			structTimeTExpected.tm_mon = 12 - 1;
			structTimeTExpected.tm_mday = 11;
			structTimeTExpected.tm_hour = 18;
			structTimeTExpected.tm_min = 00;
			structTimeTExpected.tm_sec = 00;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;

			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYY30In30DayMonthStart)
		{
			std::string input = "30/04/14";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 14;
			structTimeTExpected.tm_mon = 4 - 1;
			structTimeTExpected.tm_mday = 30;
			structTimeTExpected.tm_hour = 00;
			structTimeTExpected.tm_min = 00;
			structTimeTExpected.tm_sec = 00;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYY31In30DayMonthStart)
		{
			std::string input = "31/06/15";
			std::string expectedFeedback = INPUTERROR_MDAYOUTOFRANGE30DAYMONTH;
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYY31In31DayMonthEnd)
		{
			std::string input = "31/05/16";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 16;
			structTimeTExpected.tm_mon = 5 - 1;
			structTimeTExpected.tm_mday = 31;
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYY32In31DayMonthStart)
		{
			std::string input = "32/12/15";
			std::string expectedFeedback = INPUTERROR_MDAYOUTOFRANGE31DAYMONTH;
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYY28InNonLeapYearFebStart)
		{
			std::string input = "28/02/15";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 15;
			structTimeTExpected.tm_mon = 2 - 1;
			structTimeTExpected.tm_mday = 28;
			structTimeTExpected.tm_hour = 0;
			structTimeTExpected.tm_min = 0;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYY29InNonLeapYearFebEnd)
		{
			std::string input = "29/02/13";
			std::string expectedFeedback = INPUTERROR_MDAYOUTOFRANGENONLEAPFEB;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYY29InLeapYearFebEnd)
		{
			std::string input = "29/02/16";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 16;
			structTimeTExpected.tm_mon = 2 - 1;
			structTimeTExpected.tm_mday = 29;
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYY30InNonLeapYearFebEnd)
		{
			std::string input = "30/02/19";
			std::string expectedFeedback = INPUTERROR_MDAYOUTOFRANGENONLEAPFEB;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYY30InLeapYearFebStart)
		{
			std::string input = "30/02/20";
			std::string expectedFeedback = INPUTERROR_MDAYOUTOFRANGELEAPFEB;
			std::string errorFeedback;
			bool isStart = true;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYHour0)
		{
			std::string input = "17/05/14 0050";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 14;
			structTimeTExpected.tm_mon = 5 - 1;
			structTimeTExpected.tm_mday = 17;
			structTimeTExpected.tm_hour = 0;
			structTimeTExpected.tm_min = 50;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(TomorrowHour24)
		{
			std::string input = "tomorrow 2430";
			std::string expectedFeedback = INPUTERROR_HOUROUTOFRANGE;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYHour23)
		{
			std::string input = "21/10/15 2315";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 15;
			structTimeTExpected.tm_mon = 10 - 1;
			structTimeTExpected.tm_mday = 21;
			structTimeTExpected.tm_hour = 23;
			structTimeTExpected.tm_min = 15;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYYHour24)
		{
			std::string input = "22/08/14 2430";
			std::string expectedFeedback = INPUTERROR_HOUROUTOFRANGE;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYMin0)
		{
			std::string input = "03/12/17 1200";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 17;
			structTimeTExpected.tm_mon = 12 - 1;
			structTimeTExpected.tm_mday = 3;
			structTimeTExpected.tm_hour = 12;
			structTimeTExpected.tm_min = 0;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(ThisThursdayMin60)
		{
			std::string input = "this thursday 1060";
			std::string expectedFeedback = INPUTERROR_MINOUTOFRANGE;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

		TEST_METHOD(DDMMYYMin59)
		{
			std::string input = "29/12/14 1859";
			std::string expectedFeedback = "";
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			time_t timeTExpected;
			tm structTimeTExpected;
			time(&timeTExpected);
			localtime_s(&structTimeTExpected, &timeTExpected);
			structTimeTExpected.tm_year = 100 + 14;
			structTimeTExpected.tm_mon = 12 - 1;
			structTimeTExpected.tm_mday = 29;
			structTimeTExpected.tm_hour = 18;
			structTimeTExpected.tm_min = 59;
			structTimeTExpected.tm_sec = 0;
			timeTExpected = mktime(&structTimeTExpected);
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
			Assert::AreEqual((int)timeTExpected, (int)timeT);
		}

		TEST_METHOD(DDMMYYMin60)
		{
			std::string input = "21/04/15 0860";
			std::string expectedFeedback = INPUTERROR_MINOUTOFRANGE;
			std::string errorFeedback;
			bool isStart = false;
			bool isWeekPermitted = false;
			
			time_t timeT;
			
			std::string todoFileName = "testingTodo.txt";
			std::string doneFileName = "testingDone.txt";
			Manipulator* todoTMPtr;
			todoTMPtr = new TextManipulator(todoFileName);
			Manipulator* doneTMPtr;
			doneTMPtr = new TextManipulator(doneFileName);
			TestMethods test(todoTMPtr, doneTMPtr);
			
			try {
				timeT = test.executeProcessTime(input, isStart, isWeekPermitted);
			} catch (std::exception& exception) {
				errorFeedback = exception.what();
			}

			delete todoTMPtr;
			delete doneTMPtr;
			
			Assert::AreEqual(expectedFeedback, errorFeedback);
		}

	};
}